Skip to content

ci: enforce WASM size checks for all publishable contracts#216

Merged
greatest0fallt1me merged 2 commits intoCalloraOrg:mainfrom
iammrjude:issue/138-ci-wasm-size-all-crates
Mar 31, 2026
Merged

ci: enforce WASM size checks for all publishable contracts#216
greatest0fallt1me merged 2 commits intoCalloraOrg:mainfrom
iammrjude:issue/138-ci-wasm-size-all-crates

Conversation

@iammrjude
Copy link
Copy Markdown
Contributor

Summary

Closes #138

This PR extends the WASM size check so CI covers every publishable Soroban contract crate in the workspace instead of relying on a hard-coded package list.

What changed

  • updated scripts/check-wasm-size.sh to:
    • discover contract manifests under contracts/*/Cargo.toml
    • include every crate that exposes a cdylib target
    • build all discovered contracts with the existing workspace release profile
    • print exact WASM byte sizes and remaining headroom in CI logs
    • fail if any expected artifact is missing
    • fail if any artifact exceeds Soroban's 64 KiB limit
  • updated .github/workflows/ci.yml to run the size-check script with bash
  • added README contributor notes for:
    • cargo fmt --all
    • cargo clippy --all-targets --all-features -- -D warnings
    • cargo test
    • ./scripts/check-wasm-size.sh
  • fixed an existing compile issue in contracts/settlement/src/test.rs so the workspace passes clippy and cargo test
  • included formatting-only updates required by cargo fmt --all --check

Validation

Ran locally from the workspace root:

  • cargo fmt --all
  • cargo fmt --all --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test
  • bash ./scripts/check-wasm-size.sh
  • cargo build --target wasm32-unknown-unknown --release -p callora-vault
  • stellar contract build --package callora-vault
  • cargo tarpaulin --config tarpaulin.toml

WASM size results

  • callora-revenue-pool: 21070 bytes
  • callora-settlement: 24127 bytes
  • callora-vault: 36975 bytes

All publishable contract WASM artifacts are below the 65536 byte Soroban limit.

Coverage

  • workspace line coverage: 98.16% (586/597 lines covered)

Security notes

  • no contract runtime logic was changed for the WASM-size feature itself
  • the release-size enforcement continues to rely on the existing optimized [profile.release] settings in the workspace Cargo.toml
  • the script now reduces CI blind spots by automatically covering newly added publishable cdylib contract crates, helping prevent unnoticed size regressions
  • the settlement test fix only restores the intended test setup and does not change production contract behavior

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@iammrjude Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@iammrjude
Copy link
Copy Markdown
Contributor Author

@greatest0fallt1me

I am done please review.

All checks are successful

image

@greatest0fallt1me greatest0fallt1me merged commit 1dc5174 into CalloraOrg:main Mar 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: extend check-wasm-size.sh for all publishable contract crates

2 participants